import config from '@/request/baseUrl.js'
import request from '@/request/request.js'

// 上传图片
export const commonUpload = (filePath) => {
  return new Promise((resolve) => {
		uni.uploadFile({
			url: `${config.baseUrl}/common/upload`,
			filePath: filePath,
			formData: null,
			name: 'file',
			success: data => {
				let info = JSON.parse(data.data)
				resolve(info);
			}
		});
	})
}

// 删除文件
export const deleteFile = (params) => {
	return request({
		url: "/common/deleteByPath",
		method: "post",
		data: params,
	})
}

// 系统公告
export const getNotice = (params) => {
	return request({
		url: "/weiriya/notice/list",
		method: "get",
		data: params,
	})
}